<template>
  <div>
    <div class="model-background"></div>
    <div class="model-content">
      <div class="model-pic"><img :src="modelPic" width="300" height="93"></div>
      <p class="model-topic">{{modelTopic}}</p>
      <p class="model-info">{{modelInfo}}</p>
      <div class="model">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'model',
    data () {
      return {
        modelPic: '',
        modelTopic: '',
        modelInfo: ''
      }
    },
    methods: {
      showModel (image, topic, content) {
        this.modelPic = image
        this.modelTopic = topic
        this.modelInfo = content
      }
    }
  }
</script>

<style scope lang="scss">
  .model-background{
    position: fixed;
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    top: 0;
    background: #000000;
    opacity: 0.2;
    z-index: 998;
  }
  .model-content{
    width: 300px;
    height: 304px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    background: #ffffff;
    border-radius: 7px;
    .model-topic{
      font-size: 18px;
      color: #1e1e1b;
      font-weight: bold;
      text-align: center;
      margin: 40px 0 12px;
    }
    .model-info{
      font-size: 14px;
      color: #949494;
      text-align: center;
    }
    .model{
      position: absolute;
      height: 89px;
      bottom: 0;
      left: 50%;
      width: 285px;
      border-top: 1px solid #eaeaea;
      transform: translateX(-50%);
      .two-btn{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        p{
          display: table;
          margin: 0 auto;
          span{
            display: table;
            height: 40px;
            line-height: 40px;
            width: 127px;
            text-align: center;
            float: left;
            font-size: 14px;
            border-radius: 20px;
            &:first-child{
              margin-right: 16px;
              background: #eaeaea;
              color: #b2b2b2;
            }
            &:last-child{
             background: #ffdf58;
             color: #f29c0b;
           }
          }
        }
      }
      p.one-btn{
        height: 40px;
        width: 156px;
        line-height: 40px;
        text-align: center;
        color: #f29c0b;
        background: #ffdf58;
        border-radius: 20px;
        vertical-align: middle;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
  }
</style>
